package com.stylefeng.guns.config;

import com.stylefeng.guns.core.intercept.PlatformUserInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 拦截器配置
 * @author zcj
 */
@Configuration
public class InterceptorConfig  extends WebMvcConfigurerAdapter {

    @Autowired
    private PlatformUserInterceptor platformUserInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        //平台用户拦截器
        System.out.println("========================");
//        registry.addInterceptor(platformUserInterceptor).addPathPatterns("/api/pc/**").excludePathPatterns("/api/pc/unauthorized/**");
        registry.addInterceptor(platformUserInterceptor);



        super.addInterceptors(registry);
    }
}
